package com.js.lib_common.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;

import androidx.viewpager.widget.ViewPager;


/**不能手势滑动的ViewPager
 * Created by wz on 2019/4/19.
 */
public class NoScrollHorizontalViewPager extends ViewPager {

    private boolean DISABLE=false;

    public NoScrollHorizontalViewPager(Context context){

        super(context);

    }

    public NoScrollHorizontalViewPager(Context context, AttributeSet attrs){

        super(context,attrs);

    }


    @Override
    public boolean onInterceptTouchEvent(MotionEvent arg0) {
        return DISABLE&&super.onInterceptTouchEvent(arg0);
    }

    @Override
    public boolean onTouchEvent(MotionEvent arg0) {
        return DISABLE&&super.onTouchEvent(arg0);
    }

}

